package com.nervenets.shopping.service;

import com.alibaba.fastjson.JSONObject;
import com.nervenets.general.service.TreeService;
import com.nervenets.shopping.hibernate.domain.user.User;
import com.nervenets.shopping.hibernate.domain.user.UserExtra;
import com.nervenets.shopping.hibernate.domain.user.UserWxId;
import me.chanjar.weixin.mp.bean.result.WxMpUser;

public interface UserService extends TreeService<User> {
    User findByMobile(String mobile);

    void saveUserExtras(User user, JSONObject extra);

    User findByOpenId(String openId);

    User findByUnionId(String unionId);

    void saveUserWxId(User user, WxMpUser wxMpUser, String appId);

    UserWxId findUserWxId(User user, String appId);

    void saveUserExtra(User user, String key, String value);

    UserExtra findUserExtra(User user, String key);

    void updateInviteCount(long count, long id);

    void updateGroupCountAndTime(long userId, long groupCount, long lastGroupTime);
}
